<?php
/*
 * Niken Larasati
 * larasati.n@students.amikom.ac.id
 */

class penduduk_m extends CI_Model {

    public function __construct() {
        parent::__construct();
    }

    function ambil_data() {
        $this->db->select('penduduk.nik as nik,penduduk.nama as nama,penduduk.tempat_lahir as tempat,
                            penduduk.tgl_lahir as tanggal,penduduk.jns_kel as jns_kel,kk.alamat as alamat,
                            penduduk.status as status');
        $this->db->from('penduduk');
        $this->db->join('kk', 'penduduk.nik=kk.no_kk');
        return $this->db->get();
    }

}
?>

<!--$this->db->select('penduduk.nik as nik,penduduk.nama as nama,penduduk.tempat_lahir as tempat,
                            penduduk.tgl_lahir as tanggal,penduduk.jns_kel as jns_kel,agama.agama as agama,
                            pendidikan.pendidikan as pendidikan,pekerjaan.pekerjaan as pekerjaan,
                            penduduk.status_kw as status_kw,hub_kel.hubkel as hub_kel,
                            kewarganegaraan.kewarganegaraan as kewarganegaraan,penduduk.gol_darah as gol_darah,
                            penduduk.nama_ayah as nama_ayah,penduduk.nama_ibu as nama_ibu,kk.no_kk as no_kk,
                            penduduk.tgl_nikah as tgl_nikah,penduduk.tgl_cerai as tgl_cerai,
                            penduduk.no_paspor as no_paspor,penduduk.no_kitas as no_kitas,
                            penduduk.status as status,penduduk.no_suratnikah as no_suratnikah,
                            penduduk.no_suratcerai as no_suratcerai,penduduk.no_telp as no_telp');
        $this->db->from('penduduk');
        $this->db->join('kk','penduduk.nik=kk.no_kk');
        $this->db->join('agama','penduduk.nik')
        return $this->db->get();-->